

export function useCouponUseRange() {
  const UseRangeList = [
    {
      label: "活动",
      value: 1,
    },
    {
      label: "商城",
      value: 2,
    },
    {
      label: "商城商品",
      value: 3,
    },
    {
      label: "商城商品分类",
      value: 4,
    }
  ]
  
  const getCouponUseRangeLabel = (value: number | undefined) => {
    if (!value) {
      return ""
    }
    return UseRangeList.find(item => item.value === value)?.label ?? value
  }

  return {
    UseRangeList,
    getCouponUseRangeLabel,
  }
}